package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.RewardsPunishmentRecordMapper;
import cn.classyex.business.hr.domain.RewardsPunishmentRecord;
import cn.classyex.business.hr.service.IRewardsPunishmentRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 奖惩记录管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class RewardsPunishmentRecordServiceImpl implements IRewardsPunishmentRecordService 
{
    @Autowired
    private RewardsPunishmentRecordMapper rewardsPunishmentRecordMapper;

    /**
     * 查询奖惩记录管理
     * 
     * @param rewardsPunishmentId 奖惩记录管理ID
     * @return 奖惩记录管理
     */
    @Override
    public RewardsPunishmentRecord selectRewardsPunishmentRecordById(Long rewardsPunishmentId)
    {
        return rewardsPunishmentRecordMapper.selectRewardsPunishmentRecordById(rewardsPunishmentId);
    }

    /**
     * 查询奖惩记录管理列表
     * 
     * @param rewardsPunishmentRecord 奖惩记录管理
     * @return 奖惩记录管理
     */
    @Override
    public List<RewardsPunishmentRecord> selectRewardsPunishmentRecordList(RewardsPunishmentRecord rewardsPunishmentRecord)
    {
        return rewardsPunishmentRecordMapper.selectRewardsPunishmentRecordList(rewardsPunishmentRecord);
    }

    /**
     * 新增奖惩记录管理
     * 
     * @param rewardsPunishmentRecord 奖惩记录管理
     * @return 结果
     */
    @Override
    public int insertRewardsPunishmentRecord(RewardsPunishmentRecord rewardsPunishmentRecord)
    {
        rewardsPunishmentRecord.setCreateTime(DateUtils.getNowDate());
        return rewardsPunishmentRecordMapper.insertRewardsPunishmentRecord(rewardsPunishmentRecord);
    }

    /**
     * 修改奖惩记录管理
     * 
     * @param rewardsPunishmentRecord 奖惩记录管理
     * @return 结果
     */
    @Override
    public int updateRewardsPunishmentRecord(RewardsPunishmentRecord rewardsPunishmentRecord)
    {
        rewardsPunishmentRecord.setUpdateTime(DateUtils.getNowDate());
        return rewardsPunishmentRecordMapper.updateRewardsPunishmentRecord(rewardsPunishmentRecord);
    }

    /**
     * 删除奖惩记录管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRewardsPunishmentRecordByIds(String ids)
    {
        return rewardsPunishmentRecordMapper.deleteRewardsPunishmentRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除奖惩记录管理信息
     * 
     * @param rewardsPunishmentId 奖惩记录管理ID
     * @return 结果
     */
    @Override
    public int deleteRewardsPunishmentRecordById(Long rewardsPunishmentId)
    {
        return rewardsPunishmentRecordMapper.deleteRewardsPunishmentRecordById(rewardsPunishmentId);
    }
}
